/*
 * Copyright (c) 2014. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
 * Morbi non lorem porttitor neque feugiat blandit. Ut vitae ipsum eget quam lacinia accumsan.
 * Etiam sed turpis ac ipsum condimentum fringilla. Maecenas magna.
 * Proin dapibus sapien vel ante. Aliquam erat volutpat. Pellentesque sagittis ligula eget metus.
 * Vestibulum commodo. Ut rhoncus gravida arcu.
 */

package com.jspx.txweb.table;

import com.jspx.json.NotExpose;
import com.jspx.sober.annotation.Column;
import com.jspx.sober.annotation.IDType;
import com.jspx.sober.annotation.Id;
import com.jspx.sober.annotation.Table;
import com.jspx.sober.table.OperateTable;
import com.jspx.utils.StringUtil;

import java.util.Date;

/**
 * Created by yuan on 14-2-16.
 *
 *   字典表
 *
 */
@Table(name = "jspx_option_bundle", caption = "备选表",cache = true)
public class OptionBundle extends OperateTable {

    @Id(auto = true, type = IDType.serial)
    @Column(caption = "ID", notNull = true)
    private long id;

    @Column(caption = "编码", length = 50, dataType="isLengthBetween(0,50)",notNull = false)
    private String code = StringUtil.empty;

    //昵称，中文名称方式登录
    @Column(caption = "名称", length = 80, dataType="isLengthBetween(0,50)",notNull = true)
    private String name = StringUtil.empty;

    @NotExpose
    @Column(caption = "拼音", length = 100,hidden=true,notNull = true)
    private String spelling = StringUtil.empty;

    @Column(caption = "描述", length = 200, notNull = false)
    private String description = StringUtil.empty;

    @Column(caption = "默认选择", length = 2,notNull = true)
    private int selected = 0;

    @Column(caption = "排序", notNull = true)
    private int sortType = 0;

    @Column(caption = "排序时间", notNull = true)
    private Date sortDate = new Date();

    @Column(caption = "命名空间",length = 50, notNull = true)
    private String namespace = StringUtil.empty;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getSpelling() {
        return spelling;
    }

    public void setSpelling(String spelling) {
        this.spelling = spelling;
    }

    public int getSortType() {
        return sortType;
    }

    public void setSortType(int sortType) {
        this.sortType = sortType;
    }

    public Date getSortDate() {
        return sortDate;
    }

    public void setSortDate(Date sortDate) {
        this.sortDate = sortDate;
    }

    public String getNamespace() {
        return namespace;
    }

    public void setNamespace(String namespace) {
        this.namespace = namespace;
    }

    public int getSelected() {
        return selected;
    }

    public void setSelected(int selected) {
        this.selected = selected;
    }
}